<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="com.lei.sqlGoodsJsp.entity.Page"%>
<%@page import="com.lei.sqlGoodsJsp.entity.Goods"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Page<Goods> shopList = (Page<Goods>) request.getAttribute("myShop");
	%>
	<%="数据量" + shopList.getCount()%>
	<a href="sql/add.jsp">添加</a>
	<a href="<%=request.getContextPath()%>/SessionLognServlet?method=loginOut">注销登录</a>
	<table border="1">
		<tr>
			<td>id</td>
			<td>商品编号</td>
			<td>商品名称</td>
			<td>删除标识</td>
			<td>创建时间</td>
			<td>修改时间</td>
			<td>创建者</td>
			<td>修改者</td>
			<td>操作</td>
			<%
				for (Goods myshop : shopList.getData()) {
					String timeString = simpleDateFormat.format(new Date());

			%>
		
		<tr>
			<td><%=myshop.getId()%></td>
			<td><%=myshop.getShopNumber()%></td>
			<td><%=myshop.getShopName()%></td>
			<td><%=myshop.getDeleteLogo()%></td>
			<td><%=timeString%></td>
			<td><%=timeString %></td>
			<td><%=myshop.getCreator()%></td>
			<td><%=myshop.getMender()%></td>
			</td>
			<td width='150px'><a
				href="GoodsPageServlet?method=delete&id=<%=myshop.getId()%>">删除</a>&nbsp;&nbsp;
				<a href="GoodsPageServlet?method=toUpdate&id=<%=myshop.getId()%>">修改</a></td>
		</tr>
		<%
			}
		%>
	</table>
	<%
		for (int i = 1; i <= shopList.getTotalPage(); i++) {
			if (i == shopList.getCurrentPage()) {
				//abc"
				String abc = "abc\"";
				out.print("  " + i);
			} else {
				out.print("  <a href =\"GoodsPageServlet?method=list&currentPage=" + i + "\">" + i + "</a>");

			}
		}
	%>

</body>
</html>